if else statement in java with boolean